import redis

class Redis(object):
    __pool = None

    def __init__(self):
        self.__pool = redis.ConnectionPool(host='localhost', port=6379, decode_responses=True)


    # 使用Redis连接池操作
    def get_instance(self):
        return redis.Redis(connection_pool=self.__pool)